import { createSlice } from "@reduxjs/toolkit";

const initialState = {
  start: "北京",
  end: "广州",
  date: new Date().getDate(),
  isSpeed: true,
  isSeat: true,
  isDesc: true,
  page: 1,
};

export const counterSlice = createSlice({
  name: "counter",
  initialState,
  reducers: {
    time: (state, { payload }) => {
      // 点击 时间 date+1
      state.date = payload;
    },
  },
});

// Action creators are generated for each case reducer function
export const { time } = counterSlice.actions;

export default counterSlice.reducer;
